package userLimitService

import (
	"arabApi/app/api/models/userlimitModel"
	"arabApi/app/api/requests"
	"arabApi/app/api/requests/userlimitRequest"
	"github.com/spf13/cast"
)

func RoleList(r requests.PageStruct) ([]userlimitModel.Role, int64) {
	return userlimitModel.RoleList(r)
}

func RoleAdd(r userlimitRequest.RoleAdd) uint64 {
	role := new(userlimitModel.Role)
	return role.RoleAdd(r)
}

func RoleEdit(r userlimitRequest.RoleAdd) error {
	role := new(userlimitModel.Role)
	return role.RoleEdit(r)
}

func RoleMsg(id string) userlimitModel.Role {
	return userlimitModel.GetMsgByIdR(cast.ToInt64(id))
}
